Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel: Add python envoy_entry_point #19450

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

phlax
Copy link
Member

@phlax phlax commented Jan 8, 2022

This extends the rules_python entry_point to allow data to be
added to the sandbox, and args to pass the data to the tool.

Signed-off-by: Ryan Northey ryan@synca.io

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@phlax
Copy link
Member Author

phlax commented Jan 8, 2022

with py_binary you can add other rules as data and then pass the data to the py binary as args

eg

py_binary(
    name = "cve_scan",
    srcs = ["cve_scan.py"],
    args = ["$(location :cve.yaml)"],
    data = [":cve.yaml"],
)

with entry_point you are unable to do that, this PR adds this functionality - so that you can do, eg:


envoy_entry_point(
    name = "check",
    pkg = "envoy.dependency.check",
    args = ["--repository_locations=$(location :repository_locations_metadata)"],
    data = [":repository_locations_metadata"],
)

i opened an upstream issue here bazelbuild/rules_python#600

@phlax phlax force-pushed the bazel-python-entry-point branch from bee9bc5 to 85449c8 Compare January 8, 2022 10:22
This extends the `rules_python` `entry_point` to allow data to be
added to the sandbox, and args to pass the data to the tool.

Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the bazel-python-entry-point branch from 85449c8 to d371022 Compare January 8, 2022 10:51
@phlax
Copy link
Member Author

phlax commented Jan 8, 2022

this might be unnecessary, just thinking of another possible way to do it...

@phlax
Copy link
Member Author

phlax commented Jan 8, 2022

...another possible way to do it...

which didnt work, so i think we want this PR

@htuch
Copy link
Member

htuch commented Jan 11, 2022

/wait

phlax added 2 commits January 11, 2022 12:35
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@htuch htuch merged commit a78f464 into envoyproxy:main Jan 12, 2022
htuch pushed a commit that referenced this pull request Jan 19, 2022
This is a follow up to use the macro added in #19450 for existing entry_points

Also contains a fix to use a template to create the py_binary main to ensure the py_binary retains the path to the entry point

Signed-off-by: Ryan Northey <ryan@synca.io>
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
This extends the rules_python entry_point to allow data to be
added to the sandbox, and args to pass the data to the tool.

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Josh Perry <josh.perry@mx.com>
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
This is a follow up to use the macro added in envoyproxy#19450 for existing entry_points

Also contains a fix to use a template to create the py_binary main to ensure the py_binary retains the path to the entry point

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Josh Perry <josh.perry@mx.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants